package com.su.demo;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LoggingAspect {

    @Before("@annotation(log)")
    public void logMethodCall(JoinPoint joinPoint, Log log) {
        String methodName = joinPoint.getSignature().getName();
        System.out.println("调用方法: " + methodName + ", 日志信息: " + log.value());
    }
}
